
using System;
using Habazie.kf2.Core;

namespace Habazie.kf2.GUI
{
	
	
	public class TabWindow : Gtk.Window
	{
		private TabContainer m_Container = null;
		
		public TabWindow() : base ("")
		{
			m_Container = new TabContainer (false);
			m_Container.Show ();
			Add (m_Container);
			m_Container.TitleChanged += OnTitleChanged;
			
			this.SetDefaultSize (300, 240);
		}
		
		
		public TabContainer Container {
			get { return m_Container; }
		}
		
		
		/// <summary>
		/// 	Title has changed 	
		/// </summary>
		protected virtual void OnTitleChanged (object sender, EventArgs args)
		{
//			Util.Debug ("gui", "OnTitleChanged ({0})", m_Container.Title);
			Title = m_Container.Title;
		}
		
		/*
		 * Focus events
		 */
		
		protected override bool OnFocusInEvent (Gdk.EventFocus f)
		{
			bool val = base.OnFocusInEvent (f);
			m_Container.NotifyStateEvent ();
			return val;
		}


		protected override bool OnFocusOutEvent (Gdk.EventFocus f)
		{
			bool val = base.OnFocusOutEvent (f);
			m_Container.NotifyStateEvent ();
			return val;
		}
	}
}
